/*
* @Author: xfy
* @Date:   2017-09-10 10:09:22
* @Last Modified by:   xfy
* @Last Modified time: 2017-09-13 14:06:25
*/
'use strict';
var _supper = require('util/supper.js');
var _categoryManage = {
    //获取平级子分类
    getChildrenParallelCategory : function(categoryId, resolve, reject){
        _supper.request({
            url     : _supper.getServerUrl('/categoryManage!getChildrenParallelCategory'),
            data    : {
                id : categoryId
            },
            success : resolve,
            error   : reject
        });
    },
    //获取所有子类
    getCategoryAndDeepChildrenCategroy : function(categoryId, resolve, reject){
        _supper.request({
            url     : _supper.getServerUrl('/categoryManage!getCategoryAndDeepChildrenCategroy'),
            data    : {
                id : categoryId
            },
            success : resolve,
            error   : reject
        });
    },
    //获取当前分类
    getCategory : function(categoryId, resolve, reject){
        _supper.request({
            url     : _supper.getServerUrl('/categoryManage!getCategory'),
            data    : {
                id : categoryId
            },
            success : resolve,
            error   : reject
        });
    },
    //修改品类名称
    setCategoryName : function(categoryInfo, resolve, reject){
        _supper.request({
            url     : _supper.getServerUrl('/categoryManage!setCategoryName'),
            data    : categoryInfo,
            success : resolve,
            error   : reject
        });
    },
    //添加新品类
    addCategory : function(categoryInfo, resolve, reject){
        _supper.request({
            url     : _supper.getServerUrl('/categoryManage!addCategory'),
            data    : categoryInfo,
            success : resolve,
            error   : reject
        });
    }
}
module.exports = _categoryManage;